import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import UserView from '@/views/UserInfo.vue'
import OrderView from '@/views/OrderView.vue'
import SetAddressView from '../views/SetAdress.vue'
import AddressAddView from '../views/AddressAdd.vue'
import AddressEditView from '../views/AddressEdit.vue'
import PassWordEditView from '../views/PasswordEdit.vue'
import LoginView from '../views/loginView.vue'
import RegisterView from '../views/RegisterView.vue'
import OrderDishesView from '../views/OrderDishes.vue'
import ConfirmOrder from '../views/ConfirmOrder.vue'
import AddressSelect from '../views/AddressSelect.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path: '/user',
      name: 'user',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: UserView
    },
    {
      path:'/order',
      name:'order',
      component:OrderView
    },
    {
      path:'/setaddress',
      name:'setaddress',
      component:SetAddressView
    },
    {
      path: '/addaddress',
      component: AddressAddView
    },
    {
      path: '/editaddress',
      component: AddressEditView
    },
    {
      path:'/editpassword',
      component: PassWordEditView
    },
    {
      path:'/login',
      component: LoginView
    },
    {
      path:'/register',
      component: RegisterView
    },
    {
      path:'/orderdishes/:id',
      component: OrderDishesView
    },
    {
      path:'/confirmorder',
      component: ConfirmOrder
    },
    {
      path:'/addressselect',
      component: AddressSelect
    },
  ]
})

export default router
